3.1052 \(\int \cos ^2(c+d x) \sin (c+d x) (a+b \sin (c+d x)) \, dx\)

Optimal. Leaf size=65 \[ -\frac{a \cos ^3(c+d x)}{3 d}-\frac{b \sin (c+d x) \cos ^3(c+d x)}{4 d}+\frac{b \sin (c+d x) \cos (c+d x)}{8 d}+\frac{b x}{8} \]

[Out]

(b*x)/8 - (a*Cos[c + d*x]^3)/(3*d) + (b*Cos[c + d*x]*Sin[c + d*x])/(8*d) - (b*Cos[c + d*x]^3*Sin[c + d*x])/(4*
d)

________________________________________________________________________________________

Rubi [A]  time = 0.0942328, antiderivative size = 65, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.24, Rules used = {2838, 2565, 30, 2568, 2635, 8} \[ -\frac{a \cos ^3(c+d x)}{3 d}-\frac{b \sin (c+d x) \cos ^3(c+d x)}{4 d}+\frac{b \sin (c+d x) \cos (c+d x)}{8 d}+\frac{b x}{8} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^2*Sin[c + d*x]*(a + b*Sin[c + d*x]),x]

[Out]

(b*x)/8 - (a*Cos[c + d*x]^3)/(3*d) + (b*Cos[c + d*x]*Sin[c + d*x])/(8*d) - (b*Cos[c + d*x]^3*Sin[c + d*x])/(4*
d)

Rule 2838

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)
*(x_)]), x_Symbol] :> Dist[a, Int[(g*Cos[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Dist[b/d, Int[(g*Cos[e + f*x
])^p*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x]

Rule 2565

Int[(cos[(e_.) + (f_.)*(x_)]*(a_.))^(m_.)*sin[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> -Dist[(a*f)^(-1), Subst[
Int[x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Cos[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2]
 &&  !(IntegerQ[(m - 1)/2] && GtQ[m, 0] && LeQ[m, n])

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2568

Int[(cos[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> -Simp[(a*(b*Cos[e
+ f*x])^(n + 1)*(a*Sin[e + f*x])^(m - 1))/(b*f*(m + n)), x] + Dist[(a^2*(m - 1))/(m + n), Int[(b*Cos[e + f*x])
^n*(a*Sin[e + f*x])^(m - 2), x], x] /; FreeQ[{a, b, e, f, n}, x] && GtQ[m, 1] && NeQ[m + n, 0] && IntegersQ[2*
m, 2*n]

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \cos ^2(c+d x) \sin (c+d x) (a+b \sin (c+d x)) \, dx &=a \int \cos ^2(c+d x) \sin (c+d x) \, dx+b \int \cos ^2(c+d x) \sin ^2(c+d x) \, dx\\ &=-\frac{b \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac{1}{4} b \int \cos ^2(c+d x) \, dx-\frac{a \operatorname{Subst}\left (\int x^2 \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac{a \cos ^3(c+d x)}{3 d}+\frac{b \cos (c+d x) \sin (c+d x)}{8 d}-\frac{b \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac{1}{8} b \int 1 \, dx\\ &=\frac{b x}{8}-\frac{a \cos ^3(c+d x)}{3 d}+\frac{b \cos (c+d x) \sin (c+d x)}{8 d}-\frac{b \cos ^3(c+d x) \sin (c+d x)}{4 d}\\ \end{align*}

Mathematica [A]  time = 0.110726, size = 61, normalized size = 0.94 \[ -\frac{a \cos ^3(c+d x)}{3 d}+\frac{1}{8} b \left (-\frac{\sin (4 c) \cos (4 d x)}{4 d}-\frac{\cos (4 c) \sin (4 d x)}{4 d}\right )+\frac{b x}{8} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^2*Sin[c + d*x]*(a + b*Sin[c + d*x]),x]

[Out]

(b*x)/8 - (a*Cos[c + d*x]^3)/(3*d) + (b*(-(Cos[4*d*x]*Sin[4*c])/(4*d) - (Cos[4*c]*Sin[4*d*x])/(4*d)))/8

________________________________________________________________________________________

Maple [A]  time = 0.026, size = 57, normalized size = 0.9 \begin{align*}{\frac{1}{d} \left ( -{\frac{a \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{3}}+b \left ( -{\frac{ \left ( \cos \left ( dx+c \right ) \right ) ^{3}\sin \left ( dx+c \right ) }{4}}+{\frac{\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{8}}+{\frac{dx}{8}}+{\frac{c}{8}} \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2*sin(d*x+c)*(a+b*sin(d*x+c)),x)

[Out]

1/d*(-1/3*a*cos(d*x+c)^3+b*(-1/4*cos(d*x+c)^3*sin(d*x+c)+1/8*cos(d*x+c)*sin(d*x+c)+1/8*d*x+1/8*c))

________________________________________________________________________________________

Maxima [A]  time = 1.12417, size = 53, normalized size = 0.82 \begin{align*} -\frac{32 \, a \cos \left (d x + c\right )^{3} - 3 \,{\left (4 \, d x + 4 \, c - \sin \left (4 \, d x + 4 \, c\right )\right )} b}{96 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*sin(d*x+c)*(a+b*sin(d*x+c)),x, algorithm="maxima")

[Out]

-1/96*(32*a*cos(d*x + c)^3 - 3*(4*d*x + 4*c - sin(4*d*x + 4*c))*b)/d

________________________________________________________________________________________

Fricas [A]  time = 1.46703, size = 128, normalized size = 1.97 \begin{align*} -\frac{8 \, a \cos \left (d x + c\right )^{3} - 3 \, b d x + 3 \,{\left (2 \, b \cos \left (d x + c\right )^{3} - b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{24 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*sin(d*x+c)*(a+b*sin(d*x+c)),x, algorithm="fricas")

[Out]

-1/24*(8*a*cos(d*x + c)^3 - 3*b*d*x + 3*(2*b*cos(d*x + c)^3 - b*cos(d*x + c))*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [A]  time = 1.13681, size = 119, normalized size = 1.83 \begin{align*} \begin{cases} - \frac{a \cos ^{3}{\left (c + d x \right )}}{3 d} + \frac{b x \sin ^{4}{\left (c + d x \right )}}{8} + \frac{b x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac{b x \cos ^{4}{\left (c + d x \right )}}{8} + \frac{b \sin ^{3}{\left (c + d x \right )} \cos{\left (c + d x \right )}}{8 d} - \frac{b \sin{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} & \text{for}\: d \neq 0 \\x \left (a + b \sin{\left (c \right )}\right ) \sin{\left (c \right )} \cos ^{2}{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2*sin(d*x+c)*(a+b*sin(d*x+c)),x)

[Out]

Piecewise((-a*cos(c + d*x)**3/(3*d) + b*x*sin(c + d*x)**4/8 + b*x*sin(c + d*x)**2*cos(c + d*x)**2/4 + b*x*cos(
c + d*x)**4/8 + b*sin(c + d*x)**3*cos(c + d*x)/(8*d) - b*sin(c + d*x)*cos(c + d*x)**3/(8*d), Ne(d, 0)), (x*(a
+ b*sin(c))*sin(c)*cos(c)**2, True))

________________________________________________________________________________________

Giac [A]  time = 1.26649, size = 63, normalized size = 0.97 \begin{align*} \frac{1}{8} \, b x - \frac{a \cos \left (3 \, d x + 3 \, c\right )}{12 \, d} - \frac{a \cos \left (d x + c\right )}{4 \, d} - \frac{b \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*sin(d*x+c)*(a+b*sin(d*x+c)),x, algorithm="giac")

[Out]

1/8*b*x - 1/12*a*cos(3*d*x + 3*c)/d - 1/4*a*cos(d*x + c)/d - 1/32*b*sin(4*d*x + 4*c)/d